package viper

import (
	"errors"
	"github.com/sirupsen/logrus"
	"github.com/spf13/viper"
)

func GetViper(address string) error {
	viper.SetConfigFile(address)
	err := viper.ReadInConfig()
	if err != nil {
		logrus.New().Printf("读取配置文件失败 %s: %v\n", address, err)
		return errors.New("viper read failed")
	}

	return nil
}
